import mysql from "mysql";

let pool=mysql.createPool(require("./../dbconfig"));

function query(sql,params,fn)
{
    pool.getConnection(function(err,conn)
    {
        if(!err)
        {
            conn.query(sql,params,fn);
        conn.release();
        }
        else{
            fn(err,null,null);
        }  
    })
}

module.exports={query};